<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Essential Links</h2>  
    <button @click="success">成功</button>  
    <button @click="error">错误</button>
    <button @click="warning">警告</button>
    <button @click="info">信息</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  mounted () {
    this.success()
    this.error()
  },
  methods: {
    success() {
      this.$ztip('XXX用户登录成功',{
        type: 'success',
        duration: 10000
      })
    },
    error() {
      this.$ztip('错误提示',{
        type: 'error',
        duration: 10000
      })
    },
    warning() {
      this.$ztip('警告提示',{
        type: 'warning',
        duration: 10000
      })
    },
    info() {
      this.$ztip('信息提示',{
        type: 'info',
        duration: 10000
      })
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
